﻿<%@ Page Title="Manage Machine" Language="C#" MasterPageFile="~/MasterPage.master"
    AutoEventWireup="true" CodeFile="Mng_Machine.aspx.cs" Inherits="admin_Mng_Machine" %>

<asp:Content ID="Head" ContentPlaceHolderID="head" runat="Server">
    <link href="../styles/admin.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
     <div id="top_menu">
        <div id="help_button">
            help
        </div>
                        <div id="logout">
            <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutPageUrl="../Default.aspx"
                OnLoggingOut="LoginStatus1_LoggingOut" />
        </div>
    </div>
    <div id="page_title">
        ADMINISTRATION
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div id="left_content">
        <div class="menu">
            <ul>
                <li><a href="Home.aspx">Home</a></li>
                <li><a href="Mng_Client.aspx">Manage Clients</a></li>
                <li><a href="Mng_Site.aspx">Manage Sites</a></li>
                <li><a href="#" class="current">Manage Machines</a></li>
                <li><a href="Mng_Comp.aspx">Manage Components</a></li>
                <li><a href="Mng_Report.aspx">Manage Reports</a></li>
                <li><a href="Mng_WO.aspx">Manage Work Order</a></li>
                <li><a href="Mng_FaultsRecom.aspx">Manage Faults Recommendation</a></li>
            </ul>
        </div>
    </div>
    <!-- end of left content -->
    <div id="right_content">
        <div class="content_area">
            <h2>
                Manage Machines
            </h2>
            <div class="form_box">
                <asp:Button ID="CreateMachineButton" runat="server" Text="Add New Machine" OnClick="CreateMachineButton_Click"
                    CssClass="buttons" />
                    
                <br />
                <asp:Label ID="Label1" runat="server" Text="Filter by Site"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:DropDownList ID="dpSites" runat="server" style="margin-right: 0px" AutoPostBack="True"  DataTextField="Text" DataValueField="Value"
                    OnSelectedIndexChanged="GetMachinesBySiteID" 
                  >
                </asp:DropDownList>
 
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:GridView ID="GridViewMachines" runat="server" AutoGenerateColumns="False" 
                            AllowPaging="True" AllowSorting="True"  DataKeyNames="machine_id" PageSize="20"
                            OnSelectedIndexChanged="GridViewMachines_SelectedIndexChanged" 
                            onpageindexchanging="GridViewMachines_PageIndexChanging" 
                            HorizontalAlign="Left" >
                            <Columns>
                                <asp:BoundField DataField="machine_id" HeaderText="Machine ID" ReadOnly="True"/>
                                <asp:BoundField DataField="siteName" HeaderText="Site" 
                            SortExpression="siteName">
                                    <ItemStyle CssClass="column" />
                                </asp:BoundField>
                                <asp:BoundField DataField="machineName" HeaderText="Machine" 
                            SortExpression="machineName">
                                    <ItemStyle CssClass="column" />
                                </asp:BoundField>
                                <asp:BoundField DataField="status" HeaderText="Status" SortExpression="status">
                                    <ItemStyle CssClass="column" />
                                </asp:BoundField>
                                <asp:CommandField SelectText="Details..." ShowSelectButton="True">
                                    <ItemStyle CssClass="column" />
                                </asp:CommandField>
                            </Columns>
                            <PagerStyle CssClass="pager" />
                            <HeaderStyle CssClass="header" />
                        </asp:GridView>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="dpSites" 
                            EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
                <asp:ObjectDataSource ID="MachinesOnSitesObjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetData" TypeName="DataAccess.i2iPortalTableAdapters.MachinesOnSitesTableAdapter">
                </asp:ObjectDataSource>
                <br />
            </div>
        </div>
        <!-- end of right content -->
    </div>
</asp:Content>
